package name.koppernickus.lsp.mutable.rectangle;

public class RectangleUtils {

    /**
     * Stretches input rectangle's width by factor of times. Does NOT modify height!
     *
     * @param rectangle a rectangle to stretch
     * @param times how many times width should be stretched
     * @return modified input rectangle with width' = times * width
     */
    public static MutableRectangle stretchWidth(MutableRectangle rectangle, int times) {
        int baseWidth = rectangle.getWidth();
        int newWidth = baseWidth * times;
        rectangle.setWidth(newWidth);
        return rectangle;
    }

}
